package com.mk.common;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @Author: yq
 * @Description: 集合处理类
 * @Date: Created in 2:53 PM 3/14/18
 */
public class CollectionUtil {

    /**
     * 将list集合转换为set
     * @param list
     * @param <T>
     * @return
     */
    public static <T> Set<T> listToSet(List<T> list){
        Set<T> set = new HashSet<>();
        for (T t : list) {
            set.add(t);
        }
        return set;
    }
}
